<style>
.item-btn{text-align:center;padding-bottom:15px;}
.item-sbtn{padding:15px 35px 30px 35px;}
.item-sbtn .layui-btn{float: right;}
.item-sbtn .layui-form-label{width:auto;padding-left:0;}
.oshare_info{border: 3px dashed #E6E6E6;display:block;padding:20px 0;text-align:center;font-size:12px;color:#666}
.oshare_info a{color:#1284f6;text-decoration:underline;padding-right:10px}
.upbm_not .upbm_label{color:#999}
.upbm_not .layui-input-block{display:none;}
</style>
<form class="layui-form layui-font14" name="order" action="">
<div class="notes">
  <li> <h3>小提示：</h3></li>
<li><b>1.</b>正常进行的交易，由于某些原因需要取消交易，可在此操作主动退款给买方；</li>

<li><b>2.</b>距离交易建立已超过<strong>3</strong>小时，主动退款您需额外支付买方消保赔付金 <strong style="color:#ff6600">10.00 </strong> 元。</li>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">退款原因</label>
    <div class="layui-input-block"><textarea name="txt" class="layui-textarea checkLen" lay-verify="reason_txt" style="width:90%" placeholder="简单说明本次取消交易及主动退款的原因，不能少于10个字！"></textarea></div>
</div>
<div class="layui-form-item item-sbtn" style="padding: 15px 50px 30px 52px;"><label class="layui-form-label">安全码</label>
<div class="layui-input-inline">
<input name="safe" class="layui-input" value="" lay-verify="safe" type="password" placeholder="请输入安全码" style="border:#56aa16 solid 1px;"></div><div class="layui-form-mid layui-word-aux">
&nbsp;<a href="/member/fetch/safe" target="_blank">忘记安全码？</a></div>  <input type="button" class="layui-btn layui-btn-danger" lay-submit="" lay-filter="main" value="确定退款">
</div>
<input type="hidden" name="layer" value="1">
<input type="hidden" name="role" value="sell">
<input type="hidden" name="utime" value="{$data.utime}">
<input type="hidden" name="action" value="active_back">
<input type="hidden" name="number" value="{$data.number}">
</form>
<script type="text/javascript">
var zindex=parent.layer.zIndex;//当前层INDEX
layer.title('<font color=red style="font-weight:700;font-size:14px;">卖家主动退款</font>');
 layui.use('form', function(){
 var form = layui.form();
 form.verify({
	 	reason_txt: function(value) {
			if($.trim(value).length<10)  return '原因不能少于10个字！';
		}
});
form.on('submit(main)', function(data) {
	layer.load();
	dform(data.field,'order');
return false;
});

form.on('checkbox(upbm)',function(data){
		var $div=$(data.elem).closest(".layui-form-item");
		if(data.elem.checked){
			$div.removeClass("upbm_not");
			$('.layui-textarea').attr('placeholder','请说明修改退款金额原因，不能少于10个字！');
			$('.lay-submit').val('确认修改');
		}else{
			$div.addClass("upbm_not");
			$('.layui-textarea').attr('placeholder','请说明确认收货原因，不能少于10个字！');
			$('.lay-submit').val('确认补充');
		}
});

form.on('radio(backtype)',function(data){
		var $div=$(data.elem).closest(".layui-form-item").find('.backmoney_box');
		if(data.elem.value=='part'){
			$div.show();
		}else{
			$div.hide();
		}
});
form.on('radio(cashed_type)',function(data){
	    $('.layui-btn-cashed').val($(data.elem).data('title'));
	    $('.cashed_box').hide();
		$('.cashed_box_'+data.value).show();
});

form.on('select(main_reason)',function(data){
		$(data.elem).closest(".layui-form-item").find('.layui-form-mid').html(data.elem.value=='网盘失效'?'注：如果您不需要了，请在下方明确告知卖家不要再发货！':'');
});

	form.render(); //更新全部
$('.upbm_label').click(function(){$(this).prev().click();form.render('checkbox')});
});
 document.onkeydown = function(event) {
        var target, code, tag;
        if (!event) {
            event = window.event; //针对ie浏览器
            target = event.srcElement;
            code = event.keyCode;
            if (code == 13) {
                tag = target.tagName;
                if (tag == "TEXTAREA") { return true; }
                else { return false; }
            }
        }
        else {
            target = event.target; //针对遵循w3c标准的浏览器，如Firefox
            code = event.keyCode;
            if (code == 13) {
                tag = target.tagName;
                if (tag == "INPUT") { return false; }
                else { return true; }
            }
        }
    };
if(typeof revise_money == 'function') revise_money();

</script>